package action.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import biz.FoodBiz;
import biz.NewsBiz;
import biz.impl.FoodBizImpl;
import biz.impl.NewsBizImpl;
import entity.Food;
import entity.News;


public class IndexServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        FoodBiz b= new FoodBizImpl();
        List<Food> foodlist =b.getNewFoodsTop3();
        NewsBiz nb= new NewsBizImpl();
        List<News> newslist =nb.getAllNews();
        request.setAttribute("foodlist", foodlist);
        request.setAttribute("newslist", newslist);
        
        request.getRequestDispatcher("index.jsp").forward(request, response);
	}



}
